<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Happy dong
 * Created Time: 2019-06-25 09:36
 * Modified Time: 2019-06-25 09:36
 * Version: 2.0
 */

namespace App\Modules\Employee\Criterias;
use Flower\Core\Repository\Contracts\CriteriaInterface;
use Flower\Core\Repository\Contracts\RepositoryInterface;
class FindTokenCriteria implements CriteriaInterface
{
	protected  $request;
	public function __construct($requestData)
	{
		$this->request = $requestData;
	}

	/**
     * Apply criteria in query repository
     *
     * @param                     $model
     * @param RepositoryInterface $repository
     *
     * @return mixed
     */
    public function apply($model, RepositoryInterface $repository)
    {
        $model = $model->where(['token'=>$this->request['token']]);
        return $model;
    }
}